#!/sbin/openrc-run
supervisor=supervise-daemon

command="/usr/bin/opnsense-exporter"
command_args="--opnsense.protocol=$PROTOCOL --opnsense.address=$ADDRESS --opnsense.api-key=$API_KEY --opnsense.api-secret=$API_SECRET --exporter.instance-label=$INSTANCE_LABEL $ARGS"
command_background="yes"
command_user="prometheus:prometheus"

logdir="/var/log/prometheus"
error_log="$logdir/${SVCNAME}.log"
pidfile="/var/run/${SVCNAME}.pid"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -f -o $command_user -m644 $error_log
}
